With the continuous development of Internet technology, the demands for high-throughput data exchange and various intelligent applications are increasing, and the requirements for the overall bandwidth of a network become higher and higher. In general, data switching equipments are stacked in a large network in order to meet the requirement of the large network on port number and to realize a uniform management on the data switching equipments. The users can connect a plurality of switch equipments together with stacking ports and stacking lines to form an annular or link-shaped stacking system.
In a stacking system, each switching equipment (Unit) needs a unique identifier, which refers generally to the Media Access Control (MAC) address of the switching equipment. The main purpose of a stacked topology discovery is to form an address mapping table among switching equipments and elect a master device (master unit) for managing switching equipments and a slave device (slave unit) for replacing the master device when the master device exits because of anomaly.
At present, all stacking systems adopt the principle of state machine to realize a topology discovery using the following two main methods:
Method 1: the MAC of every unit is written into the Flash memory of each unit, and then all the units are started. During a topology discovery process, each unit sends topology discovery messages carrying MAC addresses and identifier items to the other units, wherein the identifier items are generated by taking local clock values as input parameters. After receiving the topology discovery message, each unit establishes a neighborhood relationship and elects a master unit and a slave unit according to the MAC and the identifier item. At last, the master unit performs a topological calculation and sends a topology message to realize a convergence to form an address mapping table among the units.
Method 2: the MAC and the priority of each unit are written into the Flash memory of the unit, wherein the MAC of each unit in a stacking system is required to be unique, and then all the units are started. Each unit sends topology discovery messages carrying MAC addresses, priorities and the information of stacking ports to the other units, acquires the MAC addresses and the priorities of the other units from topology discovery messages received from the other units, generates new stacked topology discovery messages according to the information of the stacking ports and the MAC addresses of the other units, and sends the new stacked topology discovery messages to the other units to establish neighborhood relationship. Then, the unit elects a master unit and a slave unit according to the MAC addresses and the priorities. At last, the master unit performs a topological calculation and sends a topology message to realize a convergence to form an address mapping table among the units.
The premise of the two topology discovery methods for a stacking system is that all the units in the stacking system are synchronously initialized. However, the types of units in a stacking system may be different, so the initialization times of the units may be different, leading to a topology discovery error. As a consequence, the unit desired to be a master uint cannot be elected a master unit due to an overlong initialization time, leading to an error master unit election and an error slave unit election.